\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\edef\test{
  \number ~ 4;
}
test: \test
\end{document}